<!DOCTYPE html>

<?php



    session_start();
    //Detection de la langue et insertion dans la session ('lang')
if (isset($_COOKIE["lang"]) == false)
{
  include 'detector.php';
  exit;
}


    
    include('/Include/translations.php');
    include('/ConsoleAdmin/Include/fonctions.inc.php');
?>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1.0, user-scalable=no"/>
  <base href="."/>
  <title>Festival Rilke</title>
  <link rel="stylesheet" href="../Rilke/Include/CSS/jquery.override.css" type="text/css" />

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
    <script>
      function getRootPath()
        {
            //Locate Server Path :
            var path = location.protocol + '//' + location.host + '/Rilke';
            //alert(path);
            
            //Modifiy All Path According To The Server Path :
            var linkCon = document.getElementById('footerContact');
            var linkLan = document.getElementById('footerLanguage');
                    
            linkCon.href = path + '/Include/Contact.php';
            linkLan.href = path + '/Include/dialogLanguage.php';
            linkHome.href = path + '/index.php';
            
            //Set Image For Banner :
            var banner = document.getElementById('banner');
            
            banner.style.backgroundImage = "url('"+ path + "/Include/images/header.png')";
            banner.style.backgroundRepeat = "no-repeat";
            banner.style.backgroundPosition = "right";
        };
    </script>
</head>
<body onload="javascript:getRootPath()" style="background-color: black;" class="ui-">

    <div data-role="page" onshow="window.location.reload()" id="home" class="type-interior ui-page ui-body-c ui-page-active" style="background: black">
    <!-- Header -->
    <div id="banner" data-role="header" data-nobackbtn="true" class="ui-bar-custom ui-header" role="banner">
       <br>
       <div id="ui-titrePage1" class="ui-header-h1">Festival Rilke</div>
       <div  id="dates" class="ui-header-h1"><?php
            $dates = getDatesDebutEtFin();
            
            $datesEdition = mysql_fetch_array($dates);
            
            echo $datesEdition[0] . " - " . $datesEdition[1] ." " . $textes['mois'][$_COOKIE['lang']] . " " . $datesEdition[2];
       ?></div>
       <a id="linkHome" class="ui-hidden-accessible"></a>
    </div>
    
    <div data-role="Content" class="ui-content tableArray">
        <table class="tableInfo">
            <tr>
                <td>
                    <!--
                    <a href="/Rilke/Information/index.php" target='_self' rel="external">
                        <div class="zoneInformation">
                           <div class="pictureTitleInformation">Information</div>
                        </div>
                    </a> -->
                    
                    <a href="/Rilke/Information/index.php" data-role="button" target='_self' rel="external">Information</a>
                    
                </td>
            </tr>
        </table>
        <table class="table1">
            <tr>
                <td>
                    <a href="/Rilke/Evenements/index.php" target='_self' rel="external">
                        <div class="zoneChateau">
                           <div class="pictureTitleEvenements"><?php echo $textes['programme'][$_COOKIE['lang']] ?></div>
                        </div>
                    </a>
                </td>
            </tr>
            <tr>
                <table class="table2">
                    <tr>
                        <td>
                            <table class="table3">      
                                <tr>
                                    <td>
                                        <table class="table4">
                                            <tr>
                                                <td>
                                                    <a id="medias" href="/Rilke/Medias/index.php"  target='_self' rel="external">
                                                        <div class="zoneMedias">
                                                           <div class="pictureTitleGallery"><?php echo $textes['galerie'][$_COOKIE['lang']] ?></div>
                                                        </div>
                                                    </a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <a href="/Rilke/ZoneInteractive/index.php"  target='_self' rel="external">
                                                        <div class="zoneCreativite">
                                                           <div class="pictureTitleCreative"><?php echo $textes['espace_creatif'][$_COOKIE['lang']] ?></div>
                                                        </div>
                                                    </a>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <a href="/Rilke/Oeuvres/index.php"  target='_self'>
                                <div class="zoneOeuvre" rel="external">
                                   <div class="pictureTitleOeuvres"><?php echo $textes['les_oeuvres'][$_COOKIE['lang']] ?></div>
                                </div>
                            </a>
                        </td>
                    </tr>
                </table>
            </tr>
        </table>
    </div>  
     
    <!-- Footer -->
   <div data-role="footer" data-id="footer"  class="footer-docs ui-footer ui-bar-a">
        <!-- Navbar -->
        <div data-role="navbar">
            <ul>
                <li><a id="footerContact" data-rel="dialog" data-icon="star" data-iconpos="top"><?php echo $textes['contact_texte'][$_COOKIE['lang']] ?></a></li>
                <li><a id="footerLanguage" data-rel="dialog" data-icon="gear" data-iconpos="top"><?php echo $textes['langue'][$_COOKIE['lang']] ?></a></li>
            </ul>
        </div>
    </div>
 </div>

</body>
</html>
<?php

function getDatesDebutEtFin(){
    //connexion à la base de données
    $myConnexion = connexionDB("db_rilkemobile", "127.0.0.1:3306", "root", "");
    
    //requête pour récupérer les types d'oeuvres
    $query = "SELECT DAY(datedebut), DAY(datefin), anneeedition FROM parametres";

    $result = executeSQL($query);
    
    //fermeture de la connexion
    deconnexionDB();
    
    return $result;
}
?>
